import xlwt

def writeExcel(excelPath):
    workbook = xlwt.Workbook()
    #获取第一个sheet页
    sheet = workbook.add_sheet('git')
    row0=['列1','列2']
    for i in range(0,len(row0)):
        sheet.write(0,i,row0[i])
    sheet.write(1,0,'测试列1')
    sheet.write(1,1,'测试列2')
    workbook.save(excelPath)

if __name__ == '__main__':
    writeExcel('D:/test.xls')